package com.mooc.apigateway.controller;

import com.mooc.apigateway.common.RestResponse;
import com.mooc.apigateway.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApiUserController {

    @Autowired
    private UserService userService;

    @RequestMapping("test/getusername")
    public RestResponse<String> getusername(Long id)
    {
        return RestResponse.success(userService.getusername(id));
    }

    @RequestMapping("test")
    public RestResponse<String> test(){
        return RestResponse.success(userService.test());
    }


}
